﻿using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

namespace Leo.Core.HttpApi.Host.Filters
{
    public abstract class AbpBaseModelValidActionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            //var modelState = context.ModelState;

            //if (modelState.IsValid)
            //    return;

            //context.Result = new JsonResult(new { Code = -1, Message = "数据验证错误。", Data = new { errors = modelState.Values.Select(p => p.Errors).ToList() } });
            //context.HttpContext.Response.StatusCode = 200;
        }
    }
}
